﻿Imports System.Windows.Data

Public Class BooleanConverter
    Implements IValueConverter

    Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
        Dim bValue As Boolean = DirectCast(value, Boolean)
        If bValue Then Return "VRAI" Else Return "FAUX"
    End Function

    Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
        Dim svalue As String = DirectCast(value, String)
        If svalue = "VRAI" Then Return True Else Return False
    End Function
End Class